package com.asialjim.wechat.official.authpage;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: BaseAuthPageController ]</i></h2><strong>
 * <p> base auth page controller
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/4/5   &nbsp;&nbsp; JDK 8
 */
public interface AuthPageService {

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: redirectUrl ]</i></h3>
     * send redirect url when we-chat user click auth page
     * @param code {@link String auth code}
     * @param state {@link String state parameter}
     * @return {@link String redirect url}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/4/5 16:20
     */
    String redirectUrl(String code,String state);

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: addAuthPage ]</i></h3>
     * add auth page for we-chat app
     * @param appId {@link String app id}
     * @param url {@link String redirect url}
     * @param param {@link String url parameters}
     * @param expires {@link Integer expires in mini}
     * @return {@link Integer result code}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/4/5 16:21
     */
    AuthPage addAuthPage(String appId, String url, String param,Integer expires);

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: addAuthPage ]</i></h3>
     * add auth page for we-chat app
     * @param authPage {@link AuthPage auth page}
     * @return {@link AuthPage auth page}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/4/5 16:40
     */
    default AuthPage addAuthPage(AuthPage authPage){
        return addAuthPage(authPage.getAppid(), authPage.getUrl(),authPage.getParam(),authPage.getExpires());
    }
}
